home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_1 / makeport.zip / MAKEPORT.PAS < prev   
Pascal/Delphi Source File  |  1991-09-04  |  1KB  |  37 lines

  1. program makeport;    {This program installes com ports not installed because
  2.                       of buggy BIOSes often when a 16550 is installed, or
  3.                       deinstalled by DOS sometimes.  Simply put makeport in
  4.                       the autoexec.bat file, and the ports will be installed
  5.                       when you boot the computer.  The command format is:
  6.                          MAKEPORT           This will install com1
  7.                          MAKEPORT 1         This will also install com1
  8.                          MAKEPORT 2         This will install com2
  9.                          MAKEPORT 3         This will install com3 at 3E8
  10.                          MAKEPORT 4         This will install com4 at 2E8}
  11.  
  12.  
  13. var port :array [1..4] of word absolute $40:0;
  14.     portnum,errorcode :word;
  15.  
  16. begin
  17.   if paramcount = 0 then
  18.     port[1] := $3f8
  19.   else
  20.   begin
  21.     val(paramstr(1),portnum,errorcode);
  22.     if errorcode <> 0 then
  23.     begin
  24.       writeln('Error ',errorcode,' converting ',paramstr(1),' to a number.');
  25.       halt(1);
  26.     end;
  27.     case portnum of
  28.  
  29.       1: port[1] := $3f8;
  30.       2: port[2] := $2f8;
  31.       3: port[3] := $3e8;
  32.       4: port[4] := $2e8;
  33.     else Writeln('Com ports 0 and over 4 not supported.')
  34.     end; {case of}
  35.   end;
  36. end.
  37.